




/*
'===============================================================================
'  TuanHuy.BL.ProjectsLanguageManagerBase
'===============================================================================
*/

using System;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using TuanHuy.BLL;
using TuanHuy.DAL;
using TuanHuy.DAL.EntityClasses;
using TuanHuy.DAL.FactoryClasses;
using TuanHuy.DAL.HelperClasses;
using SD.LLBLGen.Pro.ORMSupportClasses;

namespace TuanHuy.BLL
{
	public class ProjectsLanguageManagerBase : ManagerBase
	{
		/// <summary>
		/// Purpose: Class constructor.
		/// </summary>
		
		public ProjectsLanguageManagerBase()
		{
			// Nothing for now.
		}
		
		/*public override string TableName()
        {
            return "ProjectsLanguage";
        }*/
		
		public ProjectsLanguageEntity Insert(ProjectsLanguageEntity _ProjectsLanguageEntity)
		{
			return Insert(_ProjectsLanguageEntity, "");
		}
		
		public ProjectsLanguageEntity Insert(ProjectsLanguageEntity _ProjectsLanguageEntity, string controlId)
		{
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.SaveEntity(_ProjectsLanguageEntity, true);
				ProjectsLanguageFields field = new ProjectsLanguageFields();
                //LogEntity(_ProjectsLanguageEntity, field, AcInsert, controlId);
			}
			return _ProjectsLanguageEntity;
		}

		
		public ProjectsLanguageEntity Insert(decimal Id, decimal ProjectId, string LanguageId, int CategoryId, string Name, string Descriptions, string Image, string Content)
		{
			ProjectsLanguageEntity _ProjectsLanguageEntity = new ProjectsLanguageEntity();
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				
				_ProjectsLanguageEntity.Id = Id;
				_ProjectsLanguageEntity.ProjectId = ProjectId;
				_ProjectsLanguageEntity.LanguageId = LanguageId;
				_ProjectsLanguageEntity.CategoryId = CategoryId;
				_ProjectsLanguageEntity.Name = Name;
				_ProjectsLanguageEntity.Descriptions = Descriptions;
				_ProjectsLanguageEntity.Image = Image;
				_ProjectsLanguageEntity.Content = Content;
				ProjectsLanguageFields field = new ProjectsLanguageFields();
                //LogEntity(_ProjectsLanguageEntity, field, AcInsert);
				adapter.SaveEntity(_ProjectsLanguageEntity, true);
			}
			return _ProjectsLanguageEntity;
		}

		/*public ProjectsLanguageEntity Insert(decimal ProjectId, string LanguageId, int CategoryId, string Name, string Descriptions, string Image, string Content)
		{
			ProjectsLanguageEntity _ProjectsLanguageEntity = new ProjectsLanguageEntity();
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				
				_ProjectsLanguageEntity.ProjectId = ProjectId;
				_ProjectsLanguageEntity.LanguageId = LanguageId;
				_ProjectsLanguageEntity.CategoryId = CategoryId;
				_ProjectsLanguageEntity.Name = Name;
				_ProjectsLanguageEntity.Descriptions = Descriptions;
				_ProjectsLanguageEntity.Image = Image;
				_ProjectsLanguageEntity.Content = Content;
				adapter.SaveEntity(_ProjectsLanguageEntity, true);
				ProjectsLanguageFields field = new ProjectsLanguageFields();
                //LogEntity(_ProjectsLanguageEntity, field, AcInsert);
			}
			return _ProjectsLanguageEntity;
		}*/
		
		public bool Update(ProjectsLanguageEntity _ProjectsLanguageEntity)
        {
            return Update(_ProjectsLanguageEntity, "");
        }

		public bool Update(ProjectsLanguageEntity _ProjectsLanguageEntity, string controlId)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				RelationPredicateBucket filter = new RelationPredicateBucket();
				IPredicateExpression _PredicateExpression = new PredicateExpression();
				_PredicateExpression.Add(ProjectsLanguageFields.Id == _ProjectsLanguageEntity.Id);
					
				filter.PredicateExpression.Add(_PredicateExpression);

				adapter.UpdateEntitiesDirectly(_ProjectsLanguageEntity, filter);
				toReturn = true;
				
				ProjectsLanguageFields field = new ProjectsLanguageFields();
                //LogEntity(_ProjectsLanguageEntity, field, AcUpdate, controlId);
			}
			return toReturn;
		}
		
		public bool Update(ProjectsLanguageEntity _ProjectsLanguageEntity, RelationPredicateBucket filter)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.UpdateEntitiesDirectly(_ProjectsLanguageEntity, filter);
				toReturn = true;
				
				ProjectsLanguageFields field = new ProjectsLanguageFields();
                //LogEntity(_ProjectsLanguageEntity, field, AcUpdate);
			}
			return toReturn;
		}

		public bool Update(decimal Id, decimal ProjectId, string LanguageId, int CategoryId, string Name, string Descriptions, string Image, string Content)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				ProjectsLanguageEntity _ProjectsLanguageEntity = new ProjectsLanguageEntity(Id);
				if (adapter.FetchEntity(_ProjectsLanguageEntity))
				{
				
					_ProjectsLanguageEntity.ProjectId = ProjectId;
					_ProjectsLanguageEntity.LanguageId = LanguageId;
					_ProjectsLanguageEntity.CategoryId = CategoryId;
					_ProjectsLanguageEntity.Name = Name;
					_ProjectsLanguageEntity.Descriptions = Descriptions;
					_ProjectsLanguageEntity.Image = Image;
					_ProjectsLanguageEntity.Content = Content;
					adapter.SaveEntity(_ProjectsLanguageEntity, true);
					toReturn = true;
					
					ProjectsLanguageFields field = new ProjectsLanguageFields();
					//LogEntity(_ProjectsLanguageEntity, field, AcUpdate);
				}
			}
			return toReturn;
		}

		public bool Delete(decimal Id)
		{
			bool toReturn = false;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				ProjectsLanguageEntity _ProjectsLanguageEntity = new ProjectsLanguageEntity(Id);
				if (adapter.FetchEntity(_ProjectsLanguageEntity))
				{
					adapter.DeleteEntity(_ProjectsLanguageEntity);
					toReturn = true;
				}
			}
			return toReturn;
		}
		
		public void DeleteAll() 
		{
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.DeleteEntitiesDirectly("ProjectsLanguageEntity", null);
			}
		}
		
		
		public int DeleteById(decimal Id)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("ProjectsLanguageEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByProjectId(decimal ProjectId)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.ProjectId == ProjectId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("ProjectsLanguageEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByLanguageId(string LanguageId)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.LanguageId == LanguageId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("ProjectsLanguageEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByCategoryId(int CategoryId)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.CategoryId == CategoryId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("ProjectsLanguageEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByName(string Name)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Name == Name);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("ProjectsLanguageEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByDescriptions(string Descriptions)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Descriptions == Descriptions);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("ProjectsLanguageEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByImage(string Image)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Image == Image);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("ProjectsLanguageEntity", filter);
			}
			return toReturn;
		}
		
		public int DeleteByContent(string Content)
		{
			int toReturn = 0;
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Content == Content);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				toReturn = adapter.DeleteEntitiesDirectly("ProjectsLanguageEntity", filter);
			}
			return toReturn;
		}
		

		
		public ProjectsLanguageEntity SelectOne(decimal Id)
		{
			ProjectsLanguageEntity toReturn = null;
			using(DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				ProjectsLanguageEntity _ProjectsLanguageEntity = new ProjectsLanguageEntity(Id);
				if (adapter.FetchEntity(_ProjectsLanguageEntity))
				{
					toReturn = _ProjectsLanguageEntity;
				}
			}
			return toReturn;
		}

		// Return DataTable
		public DataTable SelectAllRDT()
		{
			DataTable toReturn = new DataTable();
			EntityCollection _ProjectsLanguageCollection = new EntityCollection(new ProjectsLanguageEntityFactory());
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_ProjectsLanguageCollection.EntityFactoryToUse.CreateFields(), toReturn, null, true);
			}
			return toReturn;
		}
		
		// Return EntityCollection<ProjectsLanguageEntity>
		public EntityCollection<ProjectsLanguageEntity> SelectAllLST()
		{
			EntityCollection<ProjectsLanguageEntity> _ProjectsLanguageCollection = new EntityCollection<ProjectsLanguageEntity>();
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_ProjectsLanguageCollection, null, 0, null);
			}
			return _ProjectsLanguageCollection;
		}
		
		// Return EntityCollection<ProjectsLanguageEntity>
		public EntityCollection<ProjectsLanguageEntity> SelectAllLST_Paged(int PageNumber, int PageSize)
		{
			EntityCollection<ProjectsLanguageEntity> _ProjectsLanguageCollection = new EntityCollection<ProjectsLanguageEntity>();
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_ProjectsLanguageCollection, null, 0, null, null, PageNumber, PageSize);
			}
			return _ProjectsLanguageCollection;
		}


		
		// Return EntityCollection<ProjectsLanguageEntity>
		public EntityCollection<ProjectsLanguageEntity> SelectByIdLST(decimal Id)
		{
			EntityCollection<ProjectsLanguageEntity> _ProjectsLanguageCollection = new EntityCollection<ProjectsLanguageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_ProjectsLanguageCollection, filter, 0, null);
			}
			return _ProjectsLanguageCollection;
		}
		
		// Return EntityCollection<ProjectsLanguageEntity>
		public EntityCollection<ProjectsLanguageEntity> SelectByIdLST_Paged(decimal Id, int PageNumber, int PageSize)
		{
			EntityCollection<ProjectsLanguageEntity> _ProjectsLanguageCollection = new EntityCollection<ProjectsLanguageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_ProjectsLanguageCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _ProjectsLanguageCollection;
		}
		
		// Return DataTable
		public DataTable SelectByIdRDT(decimal Id)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _ProjectsLanguageCollection = new EntityCollection(new ProjectsLanguageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_ProjectsLanguageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByIdRDT_Paged(decimal Id, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _ProjectsLanguageCollection = new EntityCollection(new ProjectsLanguageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Id == Id);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_ProjectsLanguageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<ProjectsLanguageEntity>
		public EntityCollection<ProjectsLanguageEntity> SelectByProjectIdLST(decimal ProjectId)
		{
			EntityCollection<ProjectsLanguageEntity> _ProjectsLanguageCollection = new EntityCollection<ProjectsLanguageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.ProjectId == ProjectId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_ProjectsLanguageCollection, filter, 0, null);
			}
			return _ProjectsLanguageCollection;
		}
		
		// Return EntityCollection<ProjectsLanguageEntity>
		public EntityCollection<ProjectsLanguageEntity> SelectByProjectIdLST_Paged(decimal ProjectId, int PageNumber, int PageSize)
		{
			EntityCollection<ProjectsLanguageEntity> _ProjectsLanguageCollection = new EntityCollection<ProjectsLanguageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.ProjectId == ProjectId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_ProjectsLanguageCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _ProjectsLanguageCollection;
		}
		
		// Return DataTable
		public DataTable SelectByProjectIdRDT(decimal ProjectId)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _ProjectsLanguageCollection = new EntityCollection(new ProjectsLanguageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.ProjectId == ProjectId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_ProjectsLanguageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByProjectIdRDT_Paged(decimal ProjectId, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _ProjectsLanguageCollection = new EntityCollection(new ProjectsLanguageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.ProjectId == ProjectId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_ProjectsLanguageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<ProjectsLanguageEntity>
		public EntityCollection<ProjectsLanguageEntity> SelectByLanguageIdLST(string LanguageId)
		{
			EntityCollection<ProjectsLanguageEntity> _ProjectsLanguageCollection = new EntityCollection<ProjectsLanguageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.LanguageId == LanguageId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_ProjectsLanguageCollection, filter, 0, null);
			}
			return _ProjectsLanguageCollection;
		}
		
		// Return EntityCollection<ProjectsLanguageEntity>
		public EntityCollection<ProjectsLanguageEntity> SelectByLanguageIdLST_Paged(string LanguageId, int PageNumber, int PageSize)
		{
			EntityCollection<ProjectsLanguageEntity> _ProjectsLanguageCollection = new EntityCollection<ProjectsLanguageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.LanguageId == LanguageId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_ProjectsLanguageCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _ProjectsLanguageCollection;
		}
		
		// Return DataTable
		public DataTable SelectByLanguageIdRDT(string LanguageId)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _ProjectsLanguageCollection = new EntityCollection(new ProjectsLanguageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.LanguageId == LanguageId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_ProjectsLanguageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByLanguageIdRDT_Paged(string LanguageId, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _ProjectsLanguageCollection = new EntityCollection(new ProjectsLanguageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.LanguageId == LanguageId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_ProjectsLanguageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<ProjectsLanguageEntity>
		public EntityCollection<ProjectsLanguageEntity> SelectByCategoryIdLST(int CategoryId)
		{
			EntityCollection<ProjectsLanguageEntity> _ProjectsLanguageCollection = new EntityCollection<ProjectsLanguageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.CategoryId == CategoryId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_ProjectsLanguageCollection, filter, 0, null);
			}
			return _ProjectsLanguageCollection;
		}
		
		// Return EntityCollection<ProjectsLanguageEntity>
		public EntityCollection<ProjectsLanguageEntity> SelectByCategoryIdLST_Paged(int CategoryId, int PageNumber, int PageSize)
		{
			EntityCollection<ProjectsLanguageEntity> _ProjectsLanguageCollection = new EntityCollection<ProjectsLanguageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.CategoryId == CategoryId);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_ProjectsLanguageCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _ProjectsLanguageCollection;
		}
		
		// Return DataTable
		public DataTable SelectByCategoryIdRDT(int CategoryId)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _ProjectsLanguageCollection = new EntityCollection(new ProjectsLanguageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.CategoryId == CategoryId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_ProjectsLanguageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByCategoryIdRDT_Paged(int CategoryId, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _ProjectsLanguageCollection = new EntityCollection(new ProjectsLanguageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.CategoryId == CategoryId);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_ProjectsLanguageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<ProjectsLanguageEntity>
		public EntityCollection<ProjectsLanguageEntity> SelectByNameLST(string Name)
		{
			EntityCollection<ProjectsLanguageEntity> _ProjectsLanguageCollection = new EntityCollection<ProjectsLanguageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Name == Name);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_ProjectsLanguageCollection, filter, 0, null);
			}
			return _ProjectsLanguageCollection;
		}
		
		// Return EntityCollection<ProjectsLanguageEntity>
		public EntityCollection<ProjectsLanguageEntity> SelectByNameLST_Paged(string Name, int PageNumber, int PageSize)
		{
			EntityCollection<ProjectsLanguageEntity> _ProjectsLanguageCollection = new EntityCollection<ProjectsLanguageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Name == Name);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_ProjectsLanguageCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _ProjectsLanguageCollection;
		}
		
		// Return DataTable
		public DataTable SelectByNameRDT(string Name)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _ProjectsLanguageCollection = new EntityCollection(new ProjectsLanguageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Name == Name);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_ProjectsLanguageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByNameRDT_Paged(string Name, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _ProjectsLanguageCollection = new EntityCollection(new ProjectsLanguageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Name == Name);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_ProjectsLanguageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<ProjectsLanguageEntity>
		public EntityCollection<ProjectsLanguageEntity> SelectByDescriptionsLST(string Descriptions)
		{
			EntityCollection<ProjectsLanguageEntity> _ProjectsLanguageCollection = new EntityCollection<ProjectsLanguageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Descriptions == Descriptions);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_ProjectsLanguageCollection, filter, 0, null);
			}
			return _ProjectsLanguageCollection;
		}
		
		// Return EntityCollection<ProjectsLanguageEntity>
		public EntityCollection<ProjectsLanguageEntity> SelectByDescriptionsLST_Paged(string Descriptions, int PageNumber, int PageSize)
		{
			EntityCollection<ProjectsLanguageEntity> _ProjectsLanguageCollection = new EntityCollection<ProjectsLanguageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Descriptions == Descriptions);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_ProjectsLanguageCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _ProjectsLanguageCollection;
		}
		
		// Return DataTable
		public DataTable SelectByDescriptionsRDT(string Descriptions)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _ProjectsLanguageCollection = new EntityCollection(new ProjectsLanguageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Descriptions == Descriptions);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_ProjectsLanguageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByDescriptionsRDT_Paged(string Descriptions, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _ProjectsLanguageCollection = new EntityCollection(new ProjectsLanguageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Descriptions == Descriptions);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_ProjectsLanguageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<ProjectsLanguageEntity>
		public EntityCollection<ProjectsLanguageEntity> SelectByImageLST(string Image)
		{
			EntityCollection<ProjectsLanguageEntity> _ProjectsLanguageCollection = new EntityCollection<ProjectsLanguageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Image == Image);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_ProjectsLanguageCollection, filter, 0, null);
			}
			return _ProjectsLanguageCollection;
		}
		
		// Return EntityCollection<ProjectsLanguageEntity>
		public EntityCollection<ProjectsLanguageEntity> SelectByImageLST_Paged(string Image, int PageNumber, int PageSize)
		{
			EntityCollection<ProjectsLanguageEntity> _ProjectsLanguageCollection = new EntityCollection<ProjectsLanguageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Image == Image);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_ProjectsLanguageCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _ProjectsLanguageCollection;
		}
		
		// Return DataTable
		public DataTable SelectByImageRDT(string Image)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _ProjectsLanguageCollection = new EntityCollection(new ProjectsLanguageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Image == Image);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_ProjectsLanguageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByImageRDT_Paged(string Image, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _ProjectsLanguageCollection = new EntityCollection(new ProjectsLanguageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Image == Image);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_ProjectsLanguageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		// Return EntityCollection<ProjectsLanguageEntity>
		public EntityCollection<ProjectsLanguageEntity> SelectByContentLST(string Content)
		{
			EntityCollection<ProjectsLanguageEntity> _ProjectsLanguageCollection = new EntityCollection<ProjectsLanguageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Content == Content);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_ProjectsLanguageCollection, filter, 0, null);
			}
			return _ProjectsLanguageCollection;
		}
		
		// Return EntityCollection<ProjectsLanguageEntity>
		public EntityCollection<ProjectsLanguageEntity> SelectByContentLST_Paged(string Content, int PageNumber, int PageSize)
		{
			EntityCollection<ProjectsLanguageEntity> _ProjectsLanguageCollection = new EntityCollection<ProjectsLanguageEntity>();
			RelationPredicateBucket filter = new RelationPredicateBucket();

			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Content == Content);
			filter.PredicateExpression.Add(_PredicateExpression);
			
			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchEntityCollection(_ProjectsLanguageCollection, filter, 0, null, null, PageNumber, PageSize);
			}
			return _ProjectsLanguageCollection;
		}
		
		// Return DataTable
		public DataTable SelectByContentRDT(string Content)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _ProjectsLanguageCollection = new EntityCollection(new ProjectsLanguageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Content == Content);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_ProjectsLanguageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, true);
			}
			return toReturn;
		}
		
		// Return DataTable
		public DataTable SelectByContentRDT_Paged(string Content, int PageNumber, int PageSize)
		{
			DataTable toReturn = new DataTable();
			EntityCollection _ProjectsLanguageCollection = new EntityCollection(new ProjectsLanguageEntityFactory());
			RelationPredicateBucket filter = new RelationPredicateBucket();
			
			IPredicateExpression _PredicateExpression = new PredicateExpression();
			_PredicateExpression.Add(ProjectsLanguageFields.Content == Content);
			filter.PredicateExpression.Add(_PredicateExpression);

			using (DataAccessAdapterBase adapter = (new DataAccessAdapterFactory()).CreateAdapter())
			{
				adapter.FetchTypedList(_ProjectsLanguageCollection.EntityFactoryToUse.CreateFields(), toReturn, filter, 0, null, true, null, PageNumber, PageSize);
			}
			return toReturn;
		}


		
		

	}
}
